﻿using TI_BLE_HCI_ClientLib.BaseEntities;
using TI_BLE_HCI_ClientLib.GenericHCIEntities;
using TI_BLE_HCI_ClientLib.HCIBaseEntities;

namespace TI_BLE_HCI_ClientLib.HCICommands
{
    public class HCICommand_GAP_Device_Discovery_Request : HCIVendorSpecificCommand
    {
        private const byte CMD = 0x04;

        public enum ModeEnum
        {
            NonDiscoverableScan = 0,
            GeneralModeScan = 1,
            LimitedModeScan = 2,
            ScanForAllDevices = 3
        }

        public enum ActiveScanEnum
        {
            TurnOffActiveScanning = 0,
            TurnOnActiveScanning = 1
        }

        public enum WhiteListEnum
        {
            DontUseWhiteListDuringScanning = 0,
            UseWhiteListDuringScanning = 1
        }

        public enum ReturnStatusEnum
        {
            Success = 0,
            ScanNotAvailable = 1,
            InvalidProfileRole = 2
        }

        public HCICommand_GAP_Device_Discovery_Request(ModeEnum mode, ActiveScanEnum activeScan, WhiteListEnum whiteList)
            : base(HCIVendorSpecificCommandCSG.GAP, CMD)
        {
            var pars = new BaseEntityParameter[3];

            pars[0] = new ByteParameter((byte)mode);
            pars[1] = new ByteParameter((byte)activeScan);
            pars[2] = new ByteParameter((byte)whiteList);

            base.addParameters(pars);
        }
    }
}